/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","jquery","hammerjs","ojs/ojjquery-hammer","ojs/ojcomponentcore","ojs/ojvalidation","ojs/ojpopup"],function(a,g,b){a.Fe={};o_("EditableValueUtils",a.Fe,a);a.Fe.QHa=function(a,b){var c,d,e={};if(a&&b)switch(b){case "disabled":c=void 0!==a.attr("disabled")?!!a.prop("disabled"):void 0;break;case "pattern":c=a.prop("pattern")||void 0;break;case "placeholder":c=a.prop("placeholder")||void 0;break;case "readonly":c=void 0!==a.attr("readonly")?!!a.prop("readonly"):void 0;break;case "required":c=
a.attr("required");d=a.prop("required");c=void 0!==c?void 0!==d?!!d:!!c:void 0;break;case "title":c=void 0!==a.attr("title")?a.prop("title"):void 0;break;case "value":c=a.val()||void 0;break;default:c=a.attr(b)||void 0}void 0!==c?(e.Yfa=!0,e.value=c):e.Yfa=!1;return e};a.Fe.Cp=function(b,c,d,e){for(var h={},k=0;k<b.length;k++){var f,g=b[k];f=g.ha;var l=g.option||f,w=g.wh,g=g.Sd,y=d.element,x=d.options[l];void 0===c[l]&&(x=d.options[l],f=a.Fe.QHa(y,f),f.Yfa&&(f=f.value,w&&("boolean"===typeof w?f=a.Fe.MGa(l,
f):"function"===typeof w&&(f=w.call(d,f))),h[l]=f));w=l in h?h[l]:x;g&&"boolean"===typeof g&&a.Fe.fMa(l,w)}null!=e&&e(h);d.option(h,{_context:{Cd:!0,kb:!0}})};a.Fe.fMa=function(a,b){var c=!1;switch(a){case "required":null!==b&&"boolean"!==typeof b&&(c=!0);break;case "readOnly":case "disabled":null!==b&&"boolean"!==typeof b&&(c=!0)}if(c)throw"Option '"+a+"' has invalid value set: "+b;};a.Fe.MGa=function(a,b){var c=b;switch(a){case "required":c=b?!0:!1}return c};a.Fe.nO=function(a,b){if(a&&b){var c=
b["class"];c&&a.addClass(c);if(c=b.style){var d=a.attr("style");d?a.attr("style",d+";"+c):a.attr("style",c)}}};a.Nb=function(a){this.Init(a)};a.ub.iO(a.ub.Xe.VG,a.Nb);a.b.sa(a.Nb,a.md,"oj.PopupMessagingStrategy");a.Nb.Wx={ojRadioset:{position:"launcher",Gn:{open:"focusin mouseenter press",close:"mouseleave"}},ojCheckboxset:{position:"launcher",Gn:{open:"focusin mouseenter press",close:"mouseleave"}},ojInputText:{position:"launcher",Gn:{open:"focusin"}},ojTextArea:{position:"launcher",Gn:{open:"focusin"}},
ojInputPassword:{position:"launcher",Gn:{open:"focusin"}},ojSwitch:{position:"launcher",Gn:{open:"focusin mouseover",close:"mouseout"}},ojSlider:{position:"launcher",Gn:{open:"focusin mouseover",close:"mouseout"}},"default":{position:"launcher-wrapper",Gn:{open:"focusin"}}};a.Nb.DQ="oj-form-control-hint";a.Nb.roa="oj-form-control-hint-converter";a.Nb.toa="oj-form-control-hint-validator";a.Nb.soa="oj-form-control-hint-title";a.Nb.prototype.tt=function(b){a.Nb.u.tt.call(this,b);this.Pya()};a.Nb.prototype.ix=
function(b){a.Nb.u.ix.call(this,b);this.Bea()};a.Nb.prototype.update=function(){a.Nb.u.update.call(this);this.Bea()};a.Nb.prototype.rp=function(){this.tFa();this.Psa();a.Nb.u.rp.call(this)};a.Nb.prototype.close=function(){this.$R()};a.Nb.prototype.$R=function(){this.$$()&&this.Ef.ojPopup("close")};a.Nb.prototype.Pya=function(){this.PK||this.eCa()};a.Nb.prototype.$aa=function(b){var c,d;d=this.wl();if(this.Oqa()&&(c=this.F4(),!a.cb.hm(c))){var e=this.E8(),h=e.ojPopup("isOpen");h?h&&(b=e[0],b.innerHTML=
"",b.innerHTML=c,e.ojPopup("refresh")):("press"===b.type&&this.XAa(d),b=e[0],b.innerHTML="",b.innerHTML=c,e.ojPopup("open",d))}};a.Nb.prototype.XAa=function(a){var b=!0;this.Co=function(a){b&&(a.preventDefault(),a.stopPropagation(),"click"===a.type&&(b=!1))};a[0].addEventListener("click",this.Co,!0);a[0].addEventListener("change",this.Co,!0);a.one("touchend",function(){setTimeout(function(){b=!1},50)})};a.Nb.prototype.Oqa=function(){var a=this.Im().options,b=a.readOnly||!1;return!(a.disabled||b)};
a.Nb.prototype.Bea=function(){var a,b,c=!1,d;this.$$()&&(d=this.E8(),c=d.ojPopup("isOpen"),a=this.F4(),b=document.activeElement===this.wl()[0]?!0:!1,c?a?(b=d[0],b.innerHTML="",b.innerHTML=a,d.ojPopup("refresh")):d.ojPopup("close"):b&&a&&this.$aa(void 0))};a.Nb.prototype.tFa=function(){var b,c,d,e,h;b=(b=a.Nb.Wx[this.Im().widgetName])?b.Gn:a.Nb.Wx["default"].Gn;if(d=b.open)c=this.PK,delete this.PK,c&&(h=d.indexOf("press"),e=d.replace("press"," "),d=this.wl(),d.off(e,c),this.Co&&(d[0].removeEventListener("click",
this.Co,!0),d[0].removeEventListener("change",this.Co,!0),delete this.Co),-1!==h&&(d.rj().off("press"),d.removeData("ojHammer")));(c=b.close)&&(b=this.w5)&&this.wl().off(c,b)};a.Nb.prototype.eCa=function(){var c,d,e,h=this.wl(),k;d=(d=a.Nb.Wx[this.Im().widgetName])?d.Gn:a.Nb.Wx["default"].Gn;d.open&&(c=this.PK,c||(c=this.PK=g.proxy(this.$aa,this)),k=d.open.indexOf("press"),e=d.open.replace("press"," "),h.on(e,c),-1!==k&&(e={recognizers:[[b.Press,{time:750}]]},h.rj(e).on("press",c)));d.close&&(c=this.w5,
c||(c=this.w5=g.proxy(this.$R,this)),h.on(d.close,c))};a.Nb.prototype.Fva=function(){var b,c;(b=(b=a.Nb.Wx[this.Im().widgetName])?b.position:a.Nb.Wx["default"].position)&&("launcher"===b?c=this.wl():"launcher-wrapper"===b&&(c=this.wl().parent()));c||(c=this.Im().widget());return{my:"start bottom",at:"end top",collision:"flipcenter",of:c}};a.Nb.prototype.E8=function(){var b,c;if(this.Ef)return this.Ef;b=a.qf.Dga();c=this.Fva();b.ojPopup("option","position",c);b.ojPopup("option","close",g.proxy(this.mBa,
this));b.ojPopup("option","open",g.proxy(this.nBa,this));return this.Ef=b};a.Nb.prototype.nBa=function(b){var c=g(b.target),d=this;window.setTimeout(function(){a.Components.qZ(c)?c.ojPopup("option","autoDismiss","focusLoss"):delete d.Ef},10)};a.Nb.prototype.mBa=function(b){var c=this.wl();b=g(b.target);a.Components.qZ(b)&&(b.ojPopup("option","autoDismiss","none"),b.ojPopup("option","open",null),b.ojPopup("option","close",null));this.Co&&(c[0].removeEventListener("click",this.Co,!0),c[0].removeEventListener("change",
this.Co,!0),delete this.Co);delete this.Ef;b.children().remove()};a.Nb.prototype.Psa=function(){this.$R();a.qf.tHa()};a.Nb.prototype.F4=function(){var b=!1,c=this.Im().document[0],d=[],e="";this.k1()&&d.push(this.sR(c));(this.zP()||this.m1()||this.l1())&&d.push(this.wqa(c));g.each(d,function(d,h){h&&(b?e=e.concat(a.rb.nIa(c)):b=!0,e=e.concat(h))});return e};a.Nb.prototype.sR=function(b){var c="",d=this.YO();this.eP()&&(c=this.ZO(),c=a.rb.bfa(b,c,d,!1));return c};a.Nb.prototype.wqa=function(b){var c;
c=[];var d="",e;this.zP()&&(c=this.v0(),c=c.length?c[0]:"",d+=a.rb.$X(b,a.Nb.roa,c,!1,a.Nb.DQ));if(this.m1())for(c=this.rla(),e=0;e<c.length;e++)d+=a.rb.$X(b,a.Nb.toa,c[e],!1,a.Nb.DQ);this.l1()&&(d+=a.rb.$X(b,a.Nb.soa,this.qla(),!0,a.Nb.DQ));return d?"\x3cdiv class\x3d'oj-form-control-hints'\x3e"+d+"\x3c/div\x3e":""};a.Nb.prototype.$$=function(){return this.Ef?a.Components.qZ(this.Ef):!1};a.rb={};a.rb.$X=function(b,c,d,e,h){var k;d&&(k=g(b.createElement("div")),k.addClass(h+(" "+c)),k.append(a.rb.Y8(b,
d,e)));return k?k.get(0).outerHTML:""};a.rb.Sga=function(b){var c;switch(b){case a.ia.Vc.FATAL:c=a.va.F("oj-message.fatal");break;case a.ia.Vc.ERROR:c=a.va.F("oj-message.error");break;case a.ia.Vc.WARNING:c=a.va.F("oj-message.warning");break;case a.ia.Vc.INFO:c=a.va.F("oj-message.info");break;case a.ia.Vc.CONFIRMATION:c=a.va.F("oj-message.confirmation")}return c};a.rb.nIa=function(a){return(a=g(a.createElement("hr")))?a.get(0).outerHTML:""};a.rb.bfa=function(b,c,d,e){var h="",k,f,g=[],l={},w;for(f=
0;f<c.length;f++)k=c[f],g=k instanceof a.ia?k:new a.ia(k.summary,k.detail,k.severity),w=a.ia.tA(g.severity),l[w]||(l[w]=[]),l[w].push(g);for(f=d;f>=a.ia.Vc.CONFIRMATION;f--)for(g=l[f]||[],c=0;c<g.length;c++)k=g[c],a.p.ve(k,a.ia),w=a.ia.tA(k.severity),d=a.rb.Sga(w),d=k.summary||d,k=k.detail||"",h=h.concat(a.rb.afa(b,d,k,w,e));return h};a.rb.afa=function(b,c,d,e,h){var k,f;f=a.rb.Sga(e);k=g(b.createElement("div"));k.addClass(a.rb.uoa);h&&k.addClass(a.rb.Pva(e));h=g(b.createElement("span"));h.addClass(a.rb.Ova(e)).attr("title",
f).attr("role","img");k.append(h);e=g(b.createElement("span"));e.addClass(a.rb.xoa);f=g(b.createElement("div"));f.addClass(a.rb.Boa).text(c);e.append(f);d&&(c=a.rb.Y8(b,d,!0),b=g(b.createElement("div")),b.addClass(a.rb.yoa).append(c),e.append(b));k.append(e);return k?k.get(0).outerHTML:""};a.rb.Ova=function(b){var c;switch(b){case a.ia.Vc.FATAL:c=a.rb.j3;break;case a.ia.Vc.ERROR:c=a.rb.j3;break;case a.ia.Vc.WARNING:c=a.rb.Doa;break;case a.ia.Vc.INFO:c=a.rb.Aoa;break;case a.ia.Vc.CONFIRMATION:c=a.rb.woa}return a.rb.zma+
c};a.rb.Pva=function(b){switch(b){case a.ia.Vc.FATAL:b=a.rb.i3;break;case a.ia.Vc.ERROR:b=a.rb.i3;break;case a.ia.Vc.WARNING:b=a.rb.Coa;break;case a.ia.Vc.INFO:b=a.rb.zoa;break;default:b=a.rb.voa}return b};a.rb.Y8=function(b,c,d){var e=null;a.cb.Re(c)&&(d&&a.D.LJa(c)?e=a.D.IGa(c.substring(6,c.length-7)):(e=b.createElement("span"),e.textContent=c));return e};a.rb.zma="oj-component-icon oj-message-status-icon ";a.rb.uoa="oj-message";a.rb.Boa="oj-message-summary";a.rb.yoa="oj-message-detail";a.rb.xoa=
"oj-message-content";a.rb.j3="oj-message-error-icon";a.rb.Doa="oj-message-warning-icon";a.rb.Aoa="oj-message-info-icon";a.rb.woa="oj-message-confirmation-icon";a.rb.i3="oj-message-error";a.rb.Coa="oj-message-warning";a.rb.zoa="oj-message-info";a.rb.voa="oj-message-confirmation";a.qf={};a.qf.Dga=function(){var b=a.qf.D8(),c=b.find("."+a.qf.EQ);0===c.length?(c=g(a.qf.Eva()).hide(),c.appendTo(b),c.ojPopup({rootAttributes:{"class":a.qf.Eoa},initialFocus:"none",tail:"simple",autoDismiss:"none",modality:"modeless"})):
c=g(c[0]);return c};a.qf.tHa=function(){var b;0<a.qf.Xua()&&(b=a.qf.Dga(),b.ojPopup("destroy"),b.remove())};a.qf.D8=function(){var b=g("#"+a.qf.F2);if(0<b.length)return b;b=g("\x3cdiv\x3e");b.attr("id",a.qf.F2);b.attr("role","presentation");b.appendTo(g(document.body));return b};a.qf.Xua=function(){return a.qf.D8().find("."+a.qf.EQ).length};a.qf.Eva=function(){return"\x3cdiv class\x3d'"+a.qf.EQ+"'\x3e\x3c/div\x3e"};a.qf.EQ="oj-messaging-popup-container";a.qf.Eoa="oj-messaging-popup";a.qf.F2="__oj_messaging_popup_pool";
(function(){a.Ra("oj._ojLabel",g.oj.baseComponent,{version:"1.0.0",defaultElement:"\x3clabel\x3e",widgetEventPrefix:"oj",options:{ariaRequiredUnsupported:!1,describedById:null,help:{definition:null,source:null},required:!1,rootAttributes:null},Ja:{H3:"tooltipHelp",I3:"tooltipRequired"},widget:function(){return this.rx},refresh:function(){this._super();this.Lba();this.Hba()},Yf:function(a,b){this._super(a,b);this.Wqa();this.OR()},_ComponentCreate:function(){this._super();this.GL=this.eventNamespace+
"TouchEatClick";this.cz=this.eventNamespace+"HelpDefPopup";this.us=a.D.jf();this.tta()},dC:function(a){this.HE=a.attr("class")},iy:function(){this.HE?this.element.attr("class",this.HE):this.element.removeAttr("class")},Gj:function(){this._superApply(arguments);this.ZR()},Vm:function(){this._superApply(arguments);this.ZR()},tta:function(){var a=this.options,b=a.ariaRequiredUnsupported,c=null,d=a.required,a=this.Oaa();this.rx=this.element.wrap(this.tsa()).closest(".oj-component");this.BAa();a&&(c=this.iS());
this.N5(c);d&&(a=this.mS(),b?c.appendChild(a):this.element.before(a))},N5:function(a){this.eE()&&(this.dza(a),this.fqa())},Wqa:function(){var a=this.options.required;if(null!==a&&"boolean"!==typeof a)throw Error("Option 'required' has invalid value set: "+a);},OR:function(){var a=this.options;if(this.Oaa()&&null==a.describedById)throw Error("ojLabel's describedById option must be set if help source is set\n\r\n      or (ariaRequiredUnsupported and required is set).");},BAa:function(){var a;a=this.element.attr("class");
var b,c;if(a&&(a=a.split(/\s+/),null!=a)){c=a.length;for(var d=0;d<c;d++)b=a[d],0<b.indexOf("-label")&&(this.rx.addClass(b),this.element.removeClass(b))}},iS:function(){var a=this.rx.find(".oj-label-group"),b=document.createElement("span");b.setAttribute("id",this.options.describedById);a.prepend(b);return b},tsa:function(){var a,b,c=this.options.rootAttributes;b="oj-label oj-component";c&&(a=c["class"]);null!==a&&(b=b+" "+a);a=document.createElement("div");a.className=b;b=document.createElement("div");
b.className="oj-label-group";a.appendChild(b);return a},mS:function(){var a=this.F(this.Ja.I3),b=document.createElement("span");b.className="oj-label-required-icon oj-component-icon";b.setAttribute("role","img");b.setAttribute("title",a);b.setAttribute("aria-label",a);return b},Vra:function(b,c){var d;if(this.eE()){d=document.createElement("a");d.setAttribute("tabindex","0");d.setAttribute("target","_blank");d.className="oj-label-help-icon-anchor oj-label-help-icon oj-component-icon oj-clickable-icon-nocontext";
if(c)try{a.D.eMa(c),d.setAttribute("href",c)}catch(e){throw Error(e+". The source option ("+c+") is invalid.");}else d.setAttribute("role","img");b?d.setAttribute("aria-label",b):d.setAttribute("aria-label",this.F(this.Ja.H3))}return d},fqa:function(){var a,c=this.options.help.definition,d,e;e=this.widget().find(".oj-label-help-icon-anchor");if(0!=e.length){a=c?c:this.F(this.Ja.H3);this.Iv?(d=g(document.getElementById(this.Iv)))&&d.text(a):(c=document.createElement("div"),c.style.display="none",c.className=
"oj-help-popup-container",d=g(c),d.uniqueId(),this.Iv=d.prop("id"),d.text(a),a=document.getElementsByTagName("body")[0],a.appendChild(c));this.us&&(this.JS&&this.widget().off(this.GL),this.JS=function(){return!1});var h=this;this.QK||(this.QK=function(a){h.Pxa(a,d,e)});this.aS||(this.aS=function(){h.ZR()});if(this.us)e.rj({recognizers:[[b.Press,{time:750}]]}).on("press",this.QK);else e.on("focusin"+this.cz+" mousedown"+this.cz+" mouseover"+this.cz,this.QK),e.on("mouseout"+this.cz,this.aS);c={my:"start bottom",
at:"end top",collision:"flipcenter",of:e};d.ojPopup({position:c,modality:"modeless",rootAttributes:{"class":"oj-help-popup"}})}},Pxa:function(a,b,c){if(this.us)if("press"===a.type){var d=this.widget();d.on("click"+this.GL,this.JS);var e=this;b.on("ojclose",function(){d.off(e.GL)})}else b.off("ojclose");b.ojPopup("isOpen")||b.ojPopup("open",c)},ZR:function(){var a;null!=this.Iv&&(a=g(document.getElementById(this.Iv)),a.ojPopup("close"))},cca:function(a){this.us&&(this.widget().off(this.GL),this.JS=
null,a.rj().off(this.cz));a.off(this.cz);this.aS=this.QK=null},dca:function(){var a;if(null!=this.Iv){if(a=g(document.getElementById(this.Iv)))a.ojPopup("destroy"),a.remove();this.Iv=null}},dza:function(a){var b,c;this.eE()&&(b=this.options.help.definition,c=this.options.help.source,g(a).prepend(this.Vra(b,c)))},Oaa:function(){var a=this.options;return this.eE()||a.ariaRequiredUnsupported&&a.required},eE:function(){var a=this.options;return a.help.source||a.help.definition},Hba:function(){var a,b;
this.OR();a=this.rx.find(".oj-label-help-icon");1===a.length&&(this.cca(a),this.dca(),a.remove());b=this.eE();a=document.getElementById(this.options.describedById);b&&null==a?a=this.iS():b||null===a||0===a.children.length&&a.parentNode.removeChild(a);this.N5(a)},Lba:function(){var a,b;b=this.rx.find(".oj-label-required-icon");a=this.options.describedById;this.options.required?(this.OR(),0===b.length?this.options.ariaRequiredUnsupported?(b=document.getElementById(a),null==b&&(b=this.iS()),b.appendChild(this.mS())):
this.element.before(this.mS()):(a=this.F(this.Ja.I3),b.attr("title",a))):(b.remove(),b=document.getElementById(a),null!==b&&0===b.children.length&&b.parentNode.removeChild(b))},_setOption:function(a,b){this._superApply(arguments);"required"===a&&this.Lba();"help"===a&&this.Hba()},getNodeBySubId:function(a){var b;b=this._super(a);b||(a=a.subId,"oj-label-help-icon"===a&&(b=this.widget().find(".oj-label-help-icon")[0]),"oj-label-required-icon"===a&&(b=this.widget().find(".oj-label-required-icon")[0]));
return b||null},getSubIdByNode:function(a){var b=null;null!=a&&(a===this.widget().find(".oj-label-help-icon")[0]?b={subId:"oj-label-help-icon"}:a===this.widget().find(".oj-label-required-icon")[0]&&(b={subId:"oj-label-required-icon"}));return b||this._superApply(arguments)},_destroy:function(){var b=this.rx.find(".oj-label-help-icon");this.cca(b);this.dca();a.D.unwrap(this.element,this.rx);return this._super()}})})();var c={Vka:1,f0:2,j0:3,Q0:4,R0:5,S0:6,Pla:7,cma:8,s1:9,t1:10,fma:11},d={zt:!0,Bm:c.f0},
e={zt:!0,Bm:c.j0},f={zt:!0,Bm:c.S0},h={zt:!0,Bm:c.Q0},k={zt:!0,Bm:c.R0},l={zt:!0,Bm:c.t1};a.Ra("oj.editableValue",g.oj.baseComponent,{widgetEventPrefix:"oj",options:{disabled:!1,displayOptions:void 0,help:{definition:null,source:null},messagesCustom:void 0,messagesHidden:void 0,messagesShown:void 0,required:!1,title:"",validators:void 0,value:void 0},getNodeBySubId:function(a){return this._super(a)},isValid:function(){void 0===this.LX&&(this.LX=this.$va());return this.LX},refresh:function(){this._super();
this.F6(!0)},reset:function(){this.wI();this.GE(this.Xm.Pla);this.eW(this.options.value,!0)},showMessages:function(){var b=[],c,d,e=this.options.messagesHidden,h=!1;for(c=0;c<e.length;c++)h=!0,d=e[c],d instanceof a.be&&d.dua(),b.push(d.clone());h&&(this.FC("messagesHidden"),this.TL("messagesShown",b))},validate:function(){return this.wc(this.Si(),null,this.hC)},iC:{p0:1,ema:2,T0:3},Xm:c,hC:{Fw:!1,Bm:c.s1},Yf:function(a,b){this._super(a,b)},_ComponentCreate:function(){var a=["required","title","pattern"],
b=this.element,c=this.cna(b);this._super();this.options.messagesCustom=this.options.messagesCustom||[];this.options.messagesHidden=[];this.options.messagesShown=0<this.options.messagesCustom.length?this.ira(this.options.messagesCustom):[];this.FQ(b);this.Qu()&&(this.ks(this.options.placeholder),this.qS=!0);"input"===b[0].tagName.toLowerCase()&&g.each(a,function(a,d){d in c&&b.removeAttr(d)})},Nh:function(){this._super();this.esa();this.F6(!1);this.oK();this.GE(this.Xm.Vka);0<this.options.messagesShown.length&&
this.LE("messagesShown",this.options.messagesShown,null,!0);this.widget().addClass("oj-form-control")},dC:function(a){this.Koa(a)},iy:function(a){this.poa(a)},A1:function(a,b){switch(a){case "disabled":this.B1(a,e);break;case "converter":this.jma(a);break;case "displayOptions":this.oK();break;case "help":this.Ij(a,this.options[a]);break;case "messagesCustom":this.sAa(b);break;case "placeholder":this.lBa(b);break;case "readOnly":this.B1(a,h);break;case "required":this.kma(a);break;case "title":this.eFa();
break;case "translations":this.refresh();break;case "value":this.lma(a,b);break;case "validators":this.Px(a)}},jma:function(a){var b=!1;this.noa();this.dK()&&(b=!0);b?(this.xI(),this.WL(d)):this.Ij(a,this.options[a],!0)},B1:function(a,b){var c=!this.options[a];this.Ij(a,this.options[a]);c&&this.Cca(b)},kma:function(a){this.Ij(a,this.options[a]);this.Cca(f)},lma:function(a,b){var c=b?b._context:null,d,e=!1;c&&(e=c.originalEvent?!0:!1,d=c.zt||!1);e||(d||this.wI(null),this.GE(this.Xm.fma));this.Ij(a,
this.options[a],!0)},Px:function(){var a=!1;this.h3();this.dK()&&(a=!0);a&&(this.xI(),this.WL(l))},Nu:function(){var a=this.options.readOnly||!1;return this.options.disabled||a?!1:!0},_destroy:function(){var b,c,d=this._super();this.widget();this.wI(null,!0);this.Is().rp();if(this.nc)for(c=this.nc.length,b=0;b<c;b++)this.nc[b]&&null!=a.Components.Yc(this.nc[b])&&g(this.nc[b])._ojLabel("destroy");return d},Focus:function(){this.Xf().focus();return!0},_setOption:function(b,c,d){var e;e=!1;if("string"===
typeof b&&void 0!==c)switch(b){case "messagesHidden":e=!0;break;case "messagesShown":e=!0;break;case "rawValue":e=!0}if(e)return a.t.error(b+" option cannot be set"),this;e=this._superApply(arguments);this.A1(b,d);return e},Xf:function(){return this.element},j2:function(){var a;a=this.s7(this.element);if(null!==a&&0!==a.length)return a;a=this.element.prop("id");if(void 0!==a&&(a=g("label[for\x3d'"+a+"']"),0!==a.length))return a;a=this.element.closest("[aria-labelledby]");return 0!==a.length&&(a=this.s7(a),
null!==a&&0!==a.length)?a:null},Zx:function(){return this.element.val()},_GetMessagingLauncherElement:function(){return this.Xf()},oc:function(){var b;this.Pc||(b=this.options.converter,this.Pc=a.Na.getConverterInstance(b));return this.Pc||null},WB:function(){this.f$||(this.f$={});return this.f$},Si:function(){return this.Xf().val()},h2:function(){var b,c,d,e,h=!0,k,f,g;if(!this.pC){b=[];f=this.options.validators;d=this.WB();e=[];k=Object.keys(d);var l=k.length;if(0<l){for(c=0;c<l;c++)g=k[c],e.push(d[g]);
b=b.concat(e)}if(f){d=[];for(c=0;c<f.length;c++)k=f[c],"object"===typeof k?(k.validate&&"function"===typeof k.validate||(h=!1),h||(g=k.type)&&"string"===typeof g&&((e=a.za.sx(g))?(k=a.Uc.yf({},k.options)||{},k.converter=k.converter||this.oc(),k.label=k.label||this.zT(),k=e.createValidator(k)):a.t.error("Unable to locate a validatorFactory for the requested type: "+g)),d.push(k)):a.t.error("Unable to parse the validator provided:"+k);b=b.concat(d)}this.pC=b}return this.pC||[]},h3:function(){this.pC&&
(this.pC.length=0);this.pC=null;this.Is().update(this.Ol(this.Kk.u1))},noa:function(){this.Pc=null;this.Is().update(this.Ol(this.Kk.e0))},lo:function(){return this.options.required},pH:function(a){var b=this.Si();this.wc(b,a)},jq:function(a,b){var c={};c._context={originalEvent:b,Cd:!0,kb:!0,readOnly:!0};this.options.rawValue!==a&&this.option("rawValue",a,c)},Ij:function(a,b,c){var d=this.options.help.definition,e=this.options.help.source;switch(a){case "converter":b=this.options.value;this.eW(b,
c);break;case "disabled":this.Pba("disabled",this.options.disabled);break;case "help":this.nc&&(a=this.cT(),this.nc._ojLabel("option","describedById",a),this.nc._ojLabel("option","help",{definition:d,source:e}),this.Fba(a));break;case "required":this.Pba("required",this.lo());this.zQ(b);this.nc&&(a=this.cT(),this.nc._ojLabel("option",{describedById:a,ariaRequiredUnsupported:this.PB()}),this.nc._ojLabel("option","required",b),this.Fba(a));break;case "value":this.eW(b,c)}},zQ:function(a){var b=this.Xf();
a&&b?b.attr("aria-required",a):b.removeAttr("aria-required")},PB:function(){return!1},Vm:function(){this._superApply(arguments);this.Is().close()},Gj:function(){this._superApply(arguments);this.Is().close()},CQ:function(){this.nc&&this.nc._ojLabel("refresh");this.Pc=this.VU=null;this.h3()},Hl:function(a){var b=this.Xf();b.val()!==a&&b.val(a)},FQ:function(a){"boolean"===typeof this.options.disabled&&a.prop("disabled",this.options.disabled)},ks:function(a){this.Xf().attr("placeholder",a)},l3:function(a){this.options.placeholder=
a},Qu:function(){return this.options.placeholder},O1:function(){this.l3("");this.ks("")},wc:function(b,c,d){var e=d&&"boolean"===typeof d.Fw?d.Fw:!0;if(void 0===b)return a.t.warn("Attempt to set a value of undefined"),!1;if(e&&b===this.hva())a.t.OF>a.t.Vr&&a.t.info("Validation skipped and value option not updated as submitted value '"+b.toString?b.toString():b+" same as previous.");else if(b=this.XQ(b,c,d),void 0!==b&&this.isValid()){var h;d&&d._context&&(h=d._context);this.Dea(b,c,d&&d.Bm,h);return!0}return!1},
XQ:function(b,c,d){var e=d&&d.gMa?d.gMa:this.iC.p0,h=d&&d.Bm?d.Bm:this.Xm.cma;d=d&&d.zt||!1;if(void 0===b)a.t.warn("Attempt to set a value of undefined");else if(this.Nu()){d||this.wI(c);this.dda(b);try{return this.gDa(b,e,h,c)}catch(k){}}else a.t.OF>a.t.Vr&&a.t.info("Validation skipped and value option not set as component state does not  allow setting value. For example if the component is readonly or disabled.")},TB:function(b,c,d){return"value"===b?a.b.ek(c,d):0===b.indexOf("messages")?this.tAa(c,
d):this._superApply(arguments)},_GetDefaultStyleClass:function(){a.p.kd();return""},Kk:{mB:1,v1:2,e0:3,u1:4,o1:5},js:{disabled:"oj-disabled",required:"oj-required"},wI:function(a,b){b?(this.options.messagesHidden=[],this.options.messagesShown=[],this.options.messagesCustom=[]):(this.FC("messagesHidden",a),this.FC("messagesShown",a),this.FC("messagesCustom",a))},xI:function(){var b=this.options.messagesShown,c=b.length,d;this.FC("messagesHidden");for(var e=c-1;0<=e;e--)d=b[e],d instanceof a.be&&b.splice(e,
1);b.length!==c&&this.LE("messagesShown",b,null,!0)},LE:function(a,b,c,d){var e={},h=0===b.length&&0===this.options[a].length;if(d||!h)e._context={originalEvent:c,Cd:!0,kb:!0},"messagesCustom"!==a&&(e._context.readOnly=!0),e.changed=d||!h,this.TCa(),this.option(a,b,e),this.KFa()},FC:function(a,b){this.LE(a,[],b)},ira:function(b){var c,d=[],e;if(b&&0<b.length)for(e=0;e<b.length;e++)c=b[e],c instanceof a.ia?d.push(c.clone()):(c=new a.ia(c.summary,c.detail,c.severity),c=Object.freeze?Object.freeze(c):
c,d.push(c));return d},esa:function(){if(this.nc=this.j2()){var a=this.options.help.definition,b=this.options.help.source,c=this.options.required,d=this.PB(),e=this.cT();this.Naa(b,a,c,d)&&this.bI(e);this.nc._ojLabel({rootAttributes:{"class":this._GetDefaultStyleClass()+"-label"},describedById:e,required:c,ariaRequiredUnsupported:d,help:{definition:a,source:b}})}},F6:function(a){var b=!1;a?(this.CQ(),this.oK(),this.dK()&&(b=!0),this.xI(),b?this.WL(k):(this.lo()&&this.GE(k.Bm),this.Ij("value",this.options.value,
!0))):(this.Ij("value",this.options.value),this.Ij("required",this.options.required));this.Ij("disabled",this.options.disabled)},ZMa:function(){return this.Vaa},hva:function(){void 0===this.KV&&(this.KV="");return this.KV},s7:function(a){a=a.attr("aria-labelledby");return void 0!==a?g("label[id\x3d'"+a+"']"):null},cT:function(){this.element.uniqueId();return this.element.prop("id")+"Icons"},Naa:function(a,b,c,d){return null!=a||null!=b||c&&d},bI:function(a){var b;this.Xf().each(function(){var c=g(this).attr("aria-describedby"),
c=c?c.split(/\s+/):[];b=g.inArray(a,c);-1===b&&c.push(a);c=g.trim(c.join(" "));g(this).attr("aria-describedby",c)})},hW:function(a){this.Xf().each(function(){var b,c;c=(b=g(this).attr("aria-describedby"))?b.split(/\s+/):[];b=g.inArray(a,c);-1!==b&&c.splice(b,1);(b=g.trim(c.join(" ")))?g(this).attr("aria-describedby",b):g(this).removeAttr("aria-describedby")})},Fba:function(a){this.Naa(this.options.help.source,this.options.help.definition,this.options.required,this.PB())?this.bI(a):this.hW(a)},GJ:function(){return this.options.messagesShown.concat(this.options.messagesHidden)},
zT:function(){if(this.nc)return this.nc.text()},i9:function(){this.Hea||(this.Hea=new a.Cm(this.isValid(),this.GJ()));return this.Hea},MU:function(){return!a.ia.isValid(this.GJ())},dK:function(){return!this.isValid()&&0<this.options.messagesShown.length},oya:function(){for(var b=this.options.messagesShown,c,d,e=0;e<b.length;e++)c=b[e],c instanceof a.be&&c.S$()&&(d=d||[],d.push(c));return void 0===d?!1:!a.ia.isValid(d)},oK:function(){var a=this.Is(),b=this._GetMessagingLauncherElement(),c=this.Xf(),
d=this.Ol(this.Kk.mB);this.qS||this.O1();a.tt(b,c,d)},sAa:function(b){var c=this.options.messagesCustom,d=[],e,h,k=this.options.messagesShown,f=b?b._context:null;for(h=0;h<k.length;h++)e=k[h],e instanceof a.be&&e.S$()&&d.push(e);for(h=0;h<c.length;h++)d.push(c[h]);this.LE("messagesShown",d,f?f.originalEvent:null,b&&b.changed)},lBa:function(a){a=(a&&a._context||{}).GJa?!1:!0;this.ks(this.options.placeholder);a?(this.qS=!0,this.oc()&&this.oK()):this.qS=!1},VDa:function(a){this.Vaa=a},dda:function(a){this.KV=
a},eFa:function(){this.Is().update(this.Ol(this.Kk.o1))},TL:function(a,b,c){var d,e,h;if("object"===typeof b&&Array.isArray(b))for(h=this.options[a],d=b.length,e=0;e<d;e++)h.push(b[e]);this.LE(a,h,c,!0)},KFa:function(){this.Is().update(this.Ol())},Dea:function(a,b,c,d){d=d||{};b&&(d.originalEvent=b);switch(c){case this.Xm.f0:case this.Xm.j0:case this.Xm.Q0:case this.Xm.R0:case this.Xm.S0:case this.Xm.s1:case this.Xm.t1:d.Cd=!0,d.zt=!0}this.option({value:a},{_context:d})},TCa:function(){this.LX=void 0},
$va:function(){var a=this.GJ(),b=!0;a&&0!==a.length&&(b=!this.MU());return b},rv:function(b){var c=b,d=this.oc();d&&"object"===typeof d&&(d.format&&"function"===typeof d.format?c=d.format(b):a.t.OF>a.t.Vr&&a.t.info("converter does not support the format method."));return c},Is:function(){this.As||(this.As=new a.ub(this));return this.As},bva:function(a){var b,c=[];b="";var d;this.lo()&&(b=this.c8(),b.getHint&&"function"===typeof b.getHint&&(b=b.getHint())&&c.push(b));for(d=0;d<a.length;d++)b=a[d],
"object"===typeof b&&b.getHint&&"function"===typeof b.getHint&&(b=b.getHint())&&c.push(b);return c},c8:function(){var b;b={};var c;null==this.VU&&(b=this.options.translations?this.options.translations.required||{}:{},c={hint:b.hint||null,label:this.zT(),messageSummary:b.messageSummary||null,messageDetail:b.messageDetail||null},this.VU=(b=a.za.sx(a.Ve.VALIDATOR_TYPE_REQUIRED))?b.createValidator(c):null);return this.VU},Ol:function(a){var b={},c=this.oc(),d="",e=[];a=a||this.Kk.v1;if(a===this.Kk.mB||
a===this.Kk.v1)e=this.GJ(),this.i9().update(this.isValid(),e),b.Kka=this.i9();if(a===this.Kk.mB||a===this.Kk.e0)c&&"object"===typeof c&&c.getHint&&"function"===typeof c.getHint&&(d=c.getHint()||""),b.tfa=d;if(a===this.Kk.mB||a===this.Kk.u1)c=this.h2(),e=this.bva(c)||[],b.hMa=e;if(a===this.Kk.mB||a===this.Kk.o1)b.title=this.options.title||"";return b},tAa:function(b,c){var d=-1,e,h=!0,k=g.extend([],b),f=g.extend([],c);if(k.length!==f.length)return!1;g.each(k,function(b,c){c instanceof a.ia?e=c:(e=
new a.ia(c.summary,c.detail,c.severity),e=Object.freeze?Object.freeze(e):e);d=-1;g.each(f,function(a,b){e.cr(b)&&(d=a)});-1<d?f.splice(d,1):h=!1});return h},RK:function(b){var c=this.oc(),d=b;c&&"object"===typeof c&&(c.parse&&"function"===typeof c.parse?d=c.parse(b):a.t.OF>a.t.Vr&&a.t.info("converter does not support the parse method."));return d},eR:function(b,c){var d,e,h;b instanceof a.xg||b instanceof a.Fk?(d=b.qA(),a.p.ve(d,a.ia),h=d.severity,e=d.summary,d=d.detail):(h=a.ia.Vc.ERROR,e=a.va.F("oj-message.error"),
d=b.message||a.va.F("oj-converter.detail"));c.push({summary:e,detail:d,severity:h})},YV:function(b,c,d){var e={},h=[],k=b.YD||[];e.context=c||0;e.display=d||a.be.yx.rP;0===k.length&&this.eR(b,k);for(c=0;c<k.length;c++)b=k[c],h.push(this.Qra(b.summary,b.detail,b.severity,e));return h||null},Qra:function(b,c,d,e){b=new a.be(b,c,d,e);return b=Object.seal?Object.seal(b):b},eW:function(a,b){var c=a||this.options.value,d;d=this.Vaa;(b||c!==d)&&this.GFa(c)},Pba:function(a,b){-1!==Object.keys(this.js).indexOf(a)&&
this.widget().toggleClass(this.js[a],!!b)},GE:function(b){if(this.Nu())try{this.Gea(this.options.value,this.iC.T0)}catch(c){(b=this.YV(c,b,a.be.yx.bP))&&this.TL("messagesHidden",b)}else a.t.OF>a.t.Vr&&a.t.info("Deferred validation skipped as component is readonly or disabled.")},gDa:function(a,b,c,d){var e=a;try{b===this.iC.p0&&(e=this.RK(a)),this.Gea(e,b===this.iC.T0)}catch(h){throw a=this.YV(h,c),this.TL("messagesShown",a,d),h;}return e},Cca:function(a){var b=!0;this.dK()&&(b=!1);this.xI();b?this.lo()&&
this.GE(a.Bm):this.WL(a)},GFa:function(a,b){var c,d;this.VDa(a);c=a;try{c=this.rv(a)}catch(e){d=this.YV(e),this.TL("messagesShown",d,b)}this.Hl(c);c=this.Si();this.dda(c);this.jq(c,null)},WL:function(a){var b;b=this.XQ(this.Si(),null,a);void 0===b||!this.isValid()&&this.oya()||this.Dea(b,null,a.Bm)},Gea:function(b,c){var d=this.h2(),e,h,k=[];if(this.lo()){e=this.c8();try{e.validate(a.cb.trim(b))}catch(f){this.eR(f,k)}}if(!c)for(h=0;h<d.length;h++)if(e=d[h],"object"===typeof e)if(e.validate&&"function"===
typeof e.validate)try{e.validate(b)}catch(g){this.eR(g,k)}else a.t.OF>a.t.Vr&&a.t.info("validator does not support the validate method.");if(0<k.length)throw d=Error(),d.YD=k,d;}},!0);a.Components.Wn({editableValue:{displayOptions:a.Components.Ne(function(a){return{messages:0<=a.containers.indexOf("ojDataGrid")||0<=a.containers.indexOf("ojTable")?["notewindow"]:["inline"],converterHint:["placeholder","notewindow"],validatorHint:["notewindow"],title:["notewindow"]}})}});a.gh=function(a){this.Init(a)};
a.ub.iO(a.ub.Xe.yB,a.gh);a.b.sa(a.gh,a.md,"oj.InlineMessagingStrategy");a.gh.prototype.ix=function(b){a.gh.u.ix.call(this,b);this.Iba()};a.gh.prototype.F_=function(a){return a&&void 0!==a.Kka?!0:!1};a.gh.prototype.update=function(){a.gh.u.update.call(this);this.Iba()};a.gh.prototype.rp=function(){this.fca();a.gh.u.rp.call(this)};a.gh.prototype.Iba=function(){var a,b;b=this.Im().widget();(a=this.xqa())&&null==this.Ef&&(this.Ef=g("\x3cdiv class\x3d'oj-messaging-inline-container'\x3e\x3c/div\x3e"),this.bI(this.Ef),
this.ipa(this.Ef),b.append(this.Ef));null!=this.Ef&&(a?(b=this.Ef[0],b.innerHTML=a):this.fca())};a.gh.prototype.fca=function(){null!=this.Ef&&(this.hW(this.Ef),this.jCa(this.Ef),this.Ef.remove(),delete this.Ef)};a.gh.prototype.bI=function(b){var c,d;d=this.wl();a.p.ve(d,g);a.p.ve(b,g);b=b.uniqueId().attr("id");c=(c=d.attr("aria-describedby"))?c.split(/\s+/):[];c.push(b);c=g.trim(c.join(" "));d.attr("aria-describedby",c)};a.gh.prototype.ipa=function(b){a.p.ve(b,g);b.attr("aria-live","polite")};a.gh.prototype.hW=
function(b){var c,d;d=this.wl();a.p.ve(d,g);a.p.ve(b,g);b=b.attr("id");c=(c=d.attr("aria-describedby"))?c.split(/\s+/):[];b=g.inArray(b,c);-1!==b&&c.splice(b,1);(c=g.trim(c.join(" ")))?d.attr("aria-describedby",c):d.removeAttr("aria-describedby")};a.gh.prototype.jCa=function(b){a.p.ve(b,g);b.removeAttr("aria-live")};a.gh.prototype.xqa=function(){var a;return this.k1()?(a=this.Im().document[0],this.sR(a)):""};a.gh.prototype.sR=function(b){var c="",d=this.YO();this.eP()&&(c=this.ZO(),c=a.rb.bfa(b,c,
d,!0));return c};a.Components.Xa("editableValue","baseComponent",{properties:{disabled:{type:"boolean"},displayOptions:{type:"Object"},help:{type:"Object\x3cstring, string\x3e"},messagesCustom:{type:"Array"},messagesHidden:{type:"Array"},messagesShown:{type:"Array"},required:{type:"boolean"},title:{type:"string"},validators:{type:"Array"},value:{type:"Object",writeback:!0}},methods:{getNodeBySubId:{},isValid:{},refresh:{},reset:{},showMessages:{},validate:{}},extension:{_widgetName:"editableValue"}})});